package com.jianbing.util;

import com.jianbing.http.HttpAsynClient;

/**
 * Created by Han, Tixiang on 2016/9/18 0018.
 */
public class ProxyCheckUtils {


    public static boolean checkProxyAvalible(String testURL, String host, int port, String userName, String password) {
        boolean flag = false;
        if (StringUtils.isEmpty(host) || port == 0) {
            return false;
        }
        try {
            HttpAsynClient.doGet(testURL, host, port, userName, password, true, false);
            flag = true;
        } catch (Exception e) {
            flag = false;
        }
        return flag;
    }
}
